package com.mapper;

import com.pojo.IStudent;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author 30590
 * @description 针对表【s_student】的数据库操作Mapper
 * @createDate 2024-11-18 11:05:02
 * @Entity com.pojo.IStudent
 */
public interface IStudentMapper {

    int deleteByPrimaryKey(Long id);

    int insert(IStudent record);

    int insertSelective(IStudent record);

    IStudent selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(IStudent record);

    int updateByPrimaryKey(IStudent record);

    @Select("select * from s_student where id = #{id}")
    IStudent selectStudent(int id);

    @Update("update mybatis.s_student set name=#{name},age=#{age} where id=#{id}")
    int updateStudent(IStudent student);

    @Select("select * from s_student where cid = #{id}")
    @Results({@Result(id = true, column = "id", property = "id"),
            @Result(column = "classname", property = "classname")
    })
    List<IStudent> selectStudentByCid(int cid);
}